/*
* js入口文件*/
import React from 'react';
import ReactDOM from 'react-dom';
import {HashRouter,Route,Switch} from 'react-router-dom'
import {Provider} from 'react-redux'


import "./assets/css/index.css"
import store from "./redux/store";
import Register from "./containers/register/register";
import Main from "./containers/main/main";
import Login from "./containers/login/login";

//测试socket的js
//import "../src/SocketIO/SocketIO_test"

ReactDOM.render(
    <Provider store={store}>
        <HashRouter>
            <Switch>
                <Route path = '/register' component ={Register}></Route>
                <Route path = '/login' component ={Login}></Route>
                <Route component ={Main}></Route>
            {/*    Route必须用Switch包裹 不然报错×
A <Router> may have only one child element*/}
            </Switch>
        </HashRouter>
    </Provider>
  ,
  document.getElementById('root')
);
